GitHubリポジトリからGitHub Pagesを開くブックマークレット
github.com/username/reponame <=> username.github.io/reponame
GitHub Repo <=> Pages
code:js
javascript: (function () {
const url = new URL(window.location.href);
if (url.host === "github.com") {
window.open(https://${username}.github.io/${reponame});
}
if (url.host.endsWith("github.io")) {
const username = url.hostname.split(".")0; const reponame = url.pathname.slice(1, -1);
window.open(https://github.com/${username}/${reponame});
}
})();